<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'get_users.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="<c:url value='/resources/js/jquery-1.8.3.min.js'/>"></script>

</head>

<body>
	<div id="show">
		<div id="count">总数：<em style="font-style: normal;"></em></div>
	</div>
	<script type="text/javascript">
		$(document).ready(function() {
			$.get("<c:url value='/user/get.user.count'/>",function(e){
				$("#count em").html(e);
			});
			$.ajax(
				{
					url : "<c:url value='/user/get.all.user'/>",
					success : function(e) 
					{
						for(var i=0;i<e.length;i++){
							$("#show").append(
									"<p id='name'>姓名：<span id='nameval'>"+e[i].sname+"</span></p>"	+
									"<p id='age'>年龄：<span id='ageval'>"+e[i].age+"</span></p>"
							);
						}
					}
				}

			);
		});
	</script>
</body>
</html>
